TK!2
=v
#1
:n
a
:s
b
#2
:n
b
:s
b
#3
:n
and
:s
b
#4
:n
or
:s
b
#5
:n
nand
:s
b
#6
:n
nor
:s
b
#7
:n
xor
:s
b
#8
:n
xnor
:s
b
=u
=l
=f
#1
:n
NAND
:c
Negative AND
:t
Rule
:a
a,b
:v
z
#2
:n
NOR
:c
Negative OR
:t
Rule
:a
a,b
:v
z
#3
:n
XOR
:c
Exclusive OR
:t
Rule
:a
a,b
:v
z
#4
:n
XNOR
:c
Exclusive NOR
:t
Rule
:a
a,b
:v
z
#5
:n
Half
:c
Half adder
:t
Rule
:a
a,b
:v
r,c
#6
:n
Full
:c
Full adder
:t
Rule
:a
a,b,carry_in
:v
r,carry_out
#1
:n
NAND
:z
z = NOT(AND(a,b))
/E
E
#2
:n
NOR
:z
z = NOT(OR(a,b))
/E
E
#3
:n
XOR
:z
z = NOT(EQV(a,b))
/E
E
#4
:n
XNOR
:z
z = EQV(a,b)
/E
E
#5
:n
Half
:z
r = XOR(a,b)      "                a   b
c = AND(a,b)      "                ³   ³
                  "                ÃÄÄÄ³ÄÄÄÄÄÄ¿
                  "                ³   ÃÄÄÄÄÄÄ³ÄÄÄ¿
                  "               ÚÁÄÄÄÁ¿    ÚÁÄÄÄÁ¿
                  "               ³ XOR ³    ³ AND ³
                  "               ÀÄÄÂÄÄÙ    ÀÄÄÂÄÄÙ
                  "                  ³          ³
                  "                record     carry
/E
E
#6
:n
Full
:z
(r1,c1) = Half(a,b)          "       a   b  carry
(r,c2) = Half(r1,carry_in)   "       ³   ³   ³
carry_out = OR(c1,c2)        "      ÚÁÄÄÄÁ¿  ³
                             "      ³ H A ³  ³
                             "      ÀÂÄÄÄÂÙ  ³
                             "       ³  ÚÁÄÄÄÁ¿
                             "       ³  ³ H A ³  
                             "       ³  ÀÂÄÄÄÂÙ  
                             "      ÚÁÄÄÄÁ¿  ³
                             "      ³ O R ³  ³
                             "      ÀÄÄÂÄÄÙ  ³
                             "         ³     ³
                             "  carry_out   record
/E
E
=r
#1
:r
and = AND(a,b)
#2
:r
or = OR(a,b)
#3
:r
nand = NAND(a,b)
#4
:r
nor = NOR(a,b)
#5
:r
xor = XOR(a,b)
#6
:r
xnor = XNOR(a,b)
=p
=t
#1
:n
HA
:s
Screen
:v
Vertical
:f
1
:r
""
:c
""
:t
"Half adder test"
:u
#1
:l
a
:w
10
:h
""
#2
:l
b
:w
10
:h
""
#3
:l
record
:w
10
:h
""
#4
:l
carry
:w
10
:h
""
E
#2
:n
FA
:s
Screen
:v
Vertical
:f
1
:r
""
:c
""
:t
"Full adder test"
:u
#1
:l
a
:w
10
:h
""
#2
:l
b
:w
10
:h
""
#3
:l
cry_in
:w
10
:h
""
#4
:l
record
:w
10
:h
""
#5
:l
cry_out
:w
10
:h
""
E
#3
:n
Adder
:s
Screen
:v
Horizontal
:f
1
:r
""
:c
""
:t
"8-digit binary adder"
:u
#1
:l
a
:w
10
:h
""
#2
:l
b
:w
10
:h
""
#3
:l
record
:w
10
:h
""
#4
:l
carry
:w
10
:h
""
E
=n
=g
#1
:c
.000001
:i
10
:v
Yes
:l
60
:f
66
:m
0
:w
80
:b
Yes
:a
Yes
:r
Yes
:h
No
:t
1
:n
Yes
:d
LPT1
%Tf,f,0,0,0,1,0
%Or,f,0,1,0,1,0
